spacetime dev - Replace template selection with fuzzy-filterable menu#4470
spacetime dev - Replace template selection with fuzzy-filterable menu#4470
spacetime dev - Replace template selection with fuzzy-filterable menu#4470Conversation
The old flow had two steps: (1) select from a short highlights list, then (2) if 'Use Template' was chosen, dump a flat list and type an ID. The user couldn't filter or navigate the full template list interactively. Now uses a single FuzzySelect showing all templates (ID + description). Type to fuzzy-filter by template ID or description, arrow keys to navigate, Enter to select. 'Clone from GitHub' and 'None (server only)' are at the bottom. Default highlights to the first highlighted template (react-ts). GitHub URL support is preserved — selecting 'Clone from GitHub' prompts for an owner/repo or git URL.
bfops
left a comment
There was a problem hiding this comment.
Works great for me!
Would you like to initialize a new project? yes
✔ Project name · zeke-test
✔ Project path · ./zeke-test
✔ Database name · zeke-test
? Select a template (type to filter, arrows to navigate) › rust
❯ basic-rs - A basic Rust client and server template with only stubs for code
chat-console-rs - Rust server/client implementing quickstart chat
nextjs-ts - Next.js App Router with TypeScript server
tanstack-ts - TanStack Start (React + TanStack Query/Router) with TypeScript server
chat-console-cs - C# server/client implementing quickstart chat
chat-react-ts - TypeScript server/client implementing quickstart chat
angular-ts - Angular web app with TypeScript server
if I type something that doesn't match, <Enter> does nothing.
I didn't test the github repo variant but code looks reasonable to me (and didn't change any of the details of parsing the url or anything).
spacetime dev - Replace template selection with fuzzy-filterable menu
dismissing my review because I'm waiting for another approval and I don't want the bot merging this prematurely
dialoguer's FuzzySelect clears and redraws all visible items on every keystroke. With 20+ templates the redraw area is large, causing visible flicker. Limiting to 10 visible rows (scrollable) reduces the effect.
684f81c to
a89dd79
Compare
cloutiertyler
left a comment
There was a problem hiding this comment.
This is the only one that I would change (or at least would like the chance to discuss first).
The idea with the old setup was that we'd have a more beginner friendly "pick your framework" selection, and then only if you opted to use a template would you be presented with the list of more complex template names. I think we should preserve the two step process, but I think probably both should be fuzzy selectors.
Restores the original two-step selection: 1. First menu (Select): language/framework highlights + 'Use Template' + 'None' 2. Second menu (FuzzySelect): all templates with type-to-filter, shown only when 'Use Template' is selected This keeps the fuzzy-find UX improvement for template browsing while preserving the quick-pick highlights for common choices.
…ter' into bot/fuzzy-template-select
…ter' into bot/fuzzy-template-select
This pull request updates the template system to support richer metadata and improves the interactive CLI experience for selecting templates. The main changes are the addition of a
client_frameworkfield to template metadata, a refactor of the templates JSON generation and parsing, and a redesign of the interactive template selection flow to group templates by language/framework and use fuzzy search for easier navigation.Template Metadata and Serialization Improvements:
client_frameworkfield to all template metadata files (e.g.,.template.json) and updated the Rust structs (TemplateInfo,TemplateDefinition, etc.) to support this field, enabling more descriptive and flexible template selection. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]serdefor serialization, replacing manual string building, and ensured that optional string fields serialize as empty strings when not present.CLI Interactive Template Selection Redesign:
Codebase Cleanup and API Changes:
These changes make template selection more intuitive and scalable as more templates and frameworks are added.